<template>
	<u-popup v-model="show" mode="bottom" closeable border-radius="28" @close="handClose">
		<view class="skill-pop">
			<view class="title">技巧解析</view>
			<view class="content">
				<scroll-view scroll-y style="height: 40vh;">
					<template v-if="info.content_ || info.skill_desc">
						<view>{{ info.content_ ||''}}</view>
						<view>{{info.skill_desc ||''}}</view>
					</template>
					<template v-else>
						此题无技巧解析,需强加记忆
					</template>
				</scroll-view>
			</view>
			<view class="submit" @click="handMusic" v-if="info.voice_file">
				<button>朗读</button>
			</view>
		</view>
	</u-popup>
</template>

<script>
	import {
		doSkil
	} from '@/api/skill.js'
	export default {
		data() {
			return {
				info: {},
				show: false,
			}
		},
		methods: {
			handMusic() {
				let filemp = filemp = this.info.voice_file
				this.$emit('music', filemp)
				// this.$emit('music', this.info.skill_description_voice)
			},
			showEdit(e) {
				// const {
				// 	data
				// } = await doSkil({
				// 	question_id: id
				// })
				this.info = e
				this.show = true
			},
			handClose() {
				// this.$emit('close')
				this.show = false
			}
		}

	}
</script>

<style lang="scss" scoped>
	.skill-pop {
		padding: 30rpx 0 60rpx 0;

		.title {
			text-align: center;
			font-size: 38rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #333333;
		}

		.content {
			padding: 32rpx 32rpx 0 32rpx;
			font-size: 38rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #333333;
		}

		.submit {
			button {
				width: 702rpx;
				margin-top: 20rpx;
				height: 98rpx;
				background: #36c269;
				border-radius: 16rpx 16rpx 16rpx 16rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 40rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
			}
		}
	}
</style>